<template>
  <br>
  <h3 style="color: red"><strong>{{title}}</strong></h3> <br>
  <div ref="context">操作内容</div>

<!-- 尽量不要直接操作DOM元素 -->
</template>

<script>
export default {
  name: "Demo",
  data(){
    return{
      title:"20.模板引用（直接获取/操作DOM）"
    }
  },
  methods:{
    handleDom(){
      this.$refs.context.innerHTML = "修改后的内容"
    }
  }
}
</script>

<style scoped>

</style>